Optimal. Leaf size=65 \[ -\frac {3 a^2 \tanh ^{-1}(\sin (e+f x))}{c f}+\frac {4 a^2 \sin (e+f x)}{c f (1-\cos (e+f x))}-\frac {a^2 \tan (e+f x)}{c f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3031, 2727,
3855, 3852, 8} \begin {gather*} -\frac {a^2 \tan (e+f x)}{c f}-\frac {3 a^2 \tanh ^{-1}(\sin (e+f x))}{c f}+\frac {4 a^2 \sin (e+f x)}{c f (1-\cos (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2727
Rule 3031
Rule 3852
Rule 3855
Rubi steps
\begin {align*} \int \frac {(a+a \cos (e+f x))^2 \sec ^2(e+f x)}{-c+c \cos (e+f x)} \, dx &=\int \left (\frac {4 a^2}{c (-1+\cos (e+f x))}-\frac {3 a^2 \sec (e+f x)}{c}-\frac {a^2 \sec ^2(e+f x)}{c}\right ) \, dx\\ &=-\frac {a^2 \int \sec ^2(e+f x) \, dx}{c}-\frac {\left (3 a^2\right ) \int \sec (e+f x) \, dx}{c}+\frac {\left (4 a^2\right ) \int \frac {1}{-1+\cos (e+f x)} \, dx}{c}\\ &=-\frac {3 a^2 \tanh ^{-1}(\sin (e+f x))}{c f}+\frac {4 a^2 \sin (e+f x)}{c f (1-\cos (e+f x))}+\frac {a^2 \text {Subst}(\int 1 \, dx,x,-\tan (e+f x))}{c f}\\ &=-\frac {3 a^2 \tanh ^{-1}(\sin (e+f x))}{c f}+\frac {4 a^2 \sin (e+f x)}{c f (1-\cos (e+f x))}-\frac {a^2 \tan (e+f x)}{c f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(194\) vs. \(2(65)=130\).
time = 0.92, size = 194, normalized size = 2.98 \begin {gather*} \frac {2 a^2 \sin \left (\frac {1}{2} (e+f x)\right ) \left (4 \csc \left (\frac {e}{2}\right ) \sin \left (\frac {f x}{2}\right )+\sin \left (\frac {1}{2} (e+f x)\right ) \left (-3 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )+3 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )+\frac {\sin (f x)}{\left (\cos \left (\frac {e}{2}\right )-\sin \left (\frac {e}{2}\right )\right ) \left (\cos \left (\frac {e}{2}\right )+\sin \left (\frac {e}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )}\right )\right )}{c f (-1+\cos (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.26, size = 82, normalized size = 1.26
method | result | size |
derivativedivides | \(\frac {4 a^{2} \left (\frac {1}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}+\frac {1}{4 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-4}+\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4}+\frac {1}{4 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+4}-\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4}\right )}{f c}\) | \(82\) |
default | \(\frac {4 a^{2} \left (\frac {1}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}+\frac {1}{4 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-4}+\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{4}+\frac {1}{4 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+4}-\frac {3 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{4}\right )}{f c}\) | \(82\) |
risch | \(\frac {2 i a^{2} \left (4 \,{\mathrm e}^{2 i \left (f x +e \right )}-{\mathrm e}^{i \left (f x +e \right )}+5\right )}{f c \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{c f}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{c f}\) | \(112\) |
norman | \(\frac {-\frac {4 a^{2}}{c f}-\frac {2 a^{2} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c f}+\frac {8 a^{2} \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c f}+\frac {6 a^{2} \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}+\frac {3 a^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{c f}-\frac {3 a^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{c f}\) | \(168\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 243 vs.
\(2 (67) = 134\).
time = 0.27, size = 243, normalized size = 3.74 \begin {gather*} -\frac {a^{2} {\left (\frac {\frac {3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 1}{\frac {c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {c \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} + \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{c} - \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{c}\right )} + 2 \, a^{2} {\left (\frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{c} - \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{c} - \frac {\cos \left (f x + e\right ) + 1}{c \sin \left (f x + e\right )}\right )} - \frac {a^{2} {\left (\cos \left (f x + e\right ) + 1\right )}}{c \sin \left (f x + e\right )}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 118, normalized size = 1.82 \begin {gather*} -\frac {3 \, a^{2} \cos \left (f x + e\right ) \log \left (\sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) - 3 \, a^{2} \cos \left (f x + e\right ) \log \left (-\sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) - 10 \, a^{2} \cos \left (f x + e\right )^{2} - 8 \, a^{2} \cos \left (f x + e\right ) + 2 \, a^{2}}{2 \, c f \cos \left (f x + e\right ) \sin \left (f x + e\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {a^{2} \left (\int \frac {\sec ^{2}{\left (e + f x \right )}}{\cos {\left (e + f x \right )} - 1}\, dx + \int \frac {2 \cos {\left (e + f x \right )} \sec ^{2}{\left (e + f x \right )}}{\cos {\left (e + f x \right )} - 1}\, dx + \int \frac {\cos ^{2}{\left (e + f x \right )} \sec ^{2}{\left (e + f x \right )}}{\cos {\left (e + f x \right )} - 1}\, dx\right )}{c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.49, size = 105, normalized size = 1.62 \begin {gather*} -\frac {\frac {3 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{c} - \frac {3 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{c} - \frac {2 \, {\left (3 \, a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 2 \, a^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} c}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.62, size = 77, normalized size = 1.18 \begin {gather*} \frac {6\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-4\,a^2}{c\,f\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )}-\frac {6\,a^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{c\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________